# coding: utf-8
from lxml import etree

if __name__ == '__main__':
    #1. 读取html文件获取要解析的数据
    html = None
    with open('text.html','r') as f:
        html = f.read()

    #2. 解析数据，获取指定文本
    et = etree.HTML(html)
    content = et.xpath('//div[contains(@class,"content-txt pt10")]')[0].text
    # 赞成的数量
    praise_num = et.xpath('//span[@class="fl ding"]//em')[0].text
    # 反对的数量
    oppose_num = et.xpath('//span[@class="fl cai"]//em')[0].text
    comments_num = et.xpath('//span[@class="fl det-commentClick"]//em')[0].text

